



FOR EACH dth_hist EXCLUSIVE-LOCK WHERE 
        dth_table = "ro_det" AND dth_field = "ro__dec01" AND
        dth_userid = "F019"  AND dth_mod_date = TODAY  
    :
    FOR LAST ro_det EXCLUSIVE-LOCK WHERE ro_routing = dth_key1 AND ro_op = INTEGER(dth_key2)
        AND RO_START = DATE(integer(substring(dth_key3,4,2)),INTEGER(SUBSTRING(dth_key3,7,2)),INTEGER("20" + SUBSTRING(dth_key3,1,2)))
/*         AND STRING(YEAR(ro_start),"99") + "/" + STRING(MONTH(RO_START),"99") + "/" + STRING(DAY(RO_START),"99")  = dth_key3  */
        :
    END.
    IF AVAIL RO_DET THEN DO:
        DISPLAY dth_key1 dth_key2 dth_key3 dth_key8 STRING(ro_start)  dth_bef_val dth_aft_val ro__dec01 FORMAT "->>>>>>9.9<<<<" WITH WIDTH 200 STREAM-IO .
        ASSIGN DTH_KEY8 = "zhangyun" ro__dec01 = decimal(dth_bef_val).
    END.
    ELSE DO:
        DISPLAY dth_key1 dth_key2 dth_key3.
    END.


END.
